#ifndef KSAMP__H 
#define KSAMP__H

#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <errno.h>
#include <time.h>
#include <unistd.h>

#define MAX_STR 256 
#define DEC_BASE 10


/** ERROR MACROS **/
typedef enum{ 	OK = 0 , 
				ERR_CAN_NOT_OPEN_FILE, 
				ERR_CAN_NOT_CLOSE_FILE,
				ERR_CAN_NOT_PARSE_UPTIME } status_t ;  

/** AUX FUNCTIONS **/
status_t open_file(const char*,FILE **) ; 
status_t get_uptime(double*,char*) ;
void format_time(double,char*) ;
void remove_newline (char*) ; 


/** PARSE FUNCTIONS **/ 
void parse_colon (char*, char**) ;
status_t parse_uptime( char* ) ;
status_t parse_l(char*,char* ) ; 
status_t parse_cla(int,char*[]) ;

/** PRINT FUNCTIONS **/ 
status_t print_cpuinfo(void) ;  
status_t print_kernel(void) ; 
status_t print_uptime(void) ; 
status_t print_num_fs(void) ;
status_t print_host_and_time(void) ; 
status_t print_disk_requests(void) ;
status_t print_available_and_total_memory() ; 
status_t print_loadavg() ;
status_t print_s() ; 
void print_times(char*) ; 
void look_for(const char*,char*,char**,FILE*) ;
#endif
